<%@page import="cn.jhc.dao.NewUserDao"%>
<%@page import="cn.jhc.bean.UserBean"%>
<%@page import="cn.jhc.dao.NewMsgDAO"%>
<%@page import="cn.jhc.dao.MusicDAO"%>
<%@page import="cn.jhc.dao.ActDAO"%>
<%@page import="cn.jhc.dao.MsgDao"%>
<%@page import="cn.jhc.bean.MsgBean"%>
<%@page import="java.util.ArrayList"%>
<%@page import="cn.jhc.dao.ConnectionFactory"%>
<%@page import="cn.jhc.dao.NewsDAO"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="js/SpryTabbedPanels.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="css/taolunqu.css"></link>
<script type="text/javascript">
	function MM_popupMsg(msg) {

		alert(msg);

	}
</script>
<style>
* {
	border: 0;
}
</style>
<title>蓝调吉他社</title>
</head>
<body>
	<div id="wrapper">
		<jsp:include page="./header.jsp"></jsp:include>
		<div id="address">
			<a>当前位置： 讨论区</a>
		</div>
		<%
			ArrayList<MsgBean> m = new ArrayList<MsgBean>();
			MsgDao water = new MsgDao();
			water.setCon(ConnectionFactory.getConnection());
			m = water.getAllMessages(1, 6);
			request.setAttribute("water", m);
		%>
		<%
			ArrayList<MsgBean> a = new ArrayList<MsgBean>();
			ActDAO act = new ActDAO();
			act.setCon(ConnectionFactory.getConnection());
			a = act.getAllMessages(1, 6);
			request.setAttribute("act", a);
		%>
		<%
			ArrayList<MsgBean> b = new ArrayList<MsgBean>();
			MusicDAO music = new MusicDAO();
			music.setCon(ConnectionFactory.getConnection());
			b = music.getAllMessages(1, 6);
			request.setAttribute("music", b);
		%>
		<%
			ArrayList<MsgBean> n = new ArrayList<MsgBean>();
			NewMsgDAO NewMsg = new NewMsgDAO();
			NewMsg.setCon(ConnectionFactory.getConnection());
			n = NewMsg.getAllMessages(1, 6);
			request.setAttribute("News", n);
		%>
		<div id="TabbedPanels1" class="TabbedPanels">
			<ul class="TabbedPanelsTabGroup">
				<li class="TabbedPanelsTab"><a>活动区新帖</a></li>
				<li class="TabbedPanelsTab"><a>灌水区新帖</a></li>
				<li class="TabbedPanelsTab"><a>新闻区新帖</a></li>
				<li class="TabbedPanelsTab"><a>音乐区新帖</a></li>
			</ul>
			<div class="TabbedPanelsContentGroup">
				<div class="TabbedPanelsContent">
					<table width="505">
						<c:forEach items="${requestScope.act}" var="act">
							<tr>
								<td width="360" height="25"><div
										class="TabbedPanelsContent">
										<div id="title">
											<img src="images/face.gif"></img><a
												href="showActmessages.jsp?id=${act.id}">[活动区]${act.title}</a>
										</div>
									</div></td>
								<td width="80"><div align="center">${act.displayname}</div></td>
								<td><div align="right">${act.date}</div></td>
						</c:forEach>
					</table>
				</div>
				<div class="TabbedPanelsContent">
					<table width="505">
						<c:forEach items="${requestScope.water}" var="water">
							<tr>
								<td width="360" height="25"><div
										class="TabbedPanelsContent">
										<div id="title">
											<img src="images/face.gif"></img><a
												href="showmessages.jsp?id=${water.id}">[灌水区]${water.title}</a>
										</div>
									</div></td>
								<td width="80"><div align="center">${water.displayname}</div></td>
								<td><div align="right">${water.date}</div></td>
						</c:forEach>
					</table>
				</div>
				<div class="TabbedPanelsContent">
					<table width="505">
						<c:forEach items="${requestScope.News}" var="News">
							<tr>
								<td width="360" height="25"><div
										class="TabbedPanelsContent">
										<div id="title">
											<img src="images/face.gif"></img><a
												href="showNewsmessages.jsp?id=${News.id}">[新闻区]${News.title}</a>
										</div>
									</div></td>
								<td width="80"><div align="center">${News.displayname}</div></td>
								<td><div align="right">${News.date}</div></td>
						</c:forEach>
					</table>
				</div>
				<div class="TabbedPanelsContent">
					<table width="505">
						<c:forEach items="${requestScope.music}" var="music">
							<tr>
								<td width="360" height="25"><div
										class="TabbedPanelsContent">
										<div id="title">
											<img src="images/face.gif"></img><a
												href="showMusicmessages.jsp?id=${music.id}">[音乐区]${music.title}</a>
										</div>
									</div></td>
								<td width="80"><div align="center">${music.displayname}</div></td>
								<td><div align="right">${music.date}</div></td>
						</c:forEach>
					</table>
				</div>
			</div>
		</div>
		<script type="text/javascript">
			var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
		</script>
		<div id="newuser">
			<div class="usertop">
				<a>新用户</a>
			</div>
			<%
				ArrayList<UserBean> u = new ArrayList<UserBean>();
				NewUserDao user = new NewUserDao();
				user.setCon(ConnectionFactory.getConnection());
				u = user.getAllUser(1, 6);
				request.setAttribute("newuser", u);
			%>
			<div class="userdown">
				<table width="350px">
					<c:forEach items="${requestScope.newuser}" var="user">
						<tr>
							<td height="25"><div align="center">${user.name}</div></td>
							<td><div align="center">${user.displayname}</div></td>
							<td><div align="center">${user.date}</div></td>
						</tr>
					</c:forEach>
				</table>
			</div>
		</div>
		<div id="wrapperdown">
			<%
				int ActMsgCount, MsgCount, NewsMsgCount, MusicMsgCount;
				int HfActMsgCount, HfMsgCount, HfNewsMsgCount, HfMusicMsgCount;
				NewsDAO dao = new NewsDAO();
				dao.setCon(ConnectionFactory.getConnection());
				ActMsgCount = dao.getActCount();
			%>
			<%
				dao.setCon(ConnectionFactory.getConnection());
				HfActMsgCount = dao.getHfActCount();
			%>
			<%
				dao.setCon(ConnectionFactory.getConnection());
				MsgCount = dao.getCount();
			%>
			<%
				dao.setCon(ConnectionFactory.getConnection());
				HfMsgCount = dao.getHfCount();
			%>
			<%
				dao.setCon(ConnectionFactory.getConnection());
				NewsMsgCount = dao.getNewsCount();
			%>
			<%
				dao.setCon(ConnectionFactory.getConnection());
				HfNewsMsgCount = dao.getHfNewsCount();
			%>
			<%
				dao.setCon(ConnectionFactory.getConnection());
				MusicMsgCount = dao.getMusicCount();
			%>
			<%
				dao.setCon(ConnectionFactory.getConnection());
				HfMusicMsgCount = dao.getHfMusicCount();
			%>
			<div id="alltaolunqu">
				<table width="900" align="left">
					<tr height="100">
						<td width="600"><a href="taolunquAct.jsp">活动讨论区</a>
							<p>活动交流，提出你的想法</p></td>
						<td><h4>主题：<%=ActMsgCount%></h4></td>
						<td><h5>回复：<%=HfActMsgCount%></h5></td>
					</tr>
					<tr height="100">
						<td><a href="taolunqu.jsp">自由灌水区</a>
							<p>休闲街区，谈生活，谈理想，谈教学，无所不谈</p></td>
						<td><h4>主题：<%=MsgCount%></h4></td>
						<td><h5>回复：<%=HfMsgCount%></h5></td>
					</tr>
					<tr height="100">
						<td><a href="taolunquMusic.jsp">音乐交流区</a>
							<p>音乐交流，交流你的音乐心得</p></td>
						<td><h4>主题：<%=MusicMsgCount%></h4></td>
						<td><h5>回复：<%=HfMusicMsgCount%></h5></td>
					</tr>
					<tr height="100">
						<td><a href="taolunquNew.jsp">新闻讨论区</a>
							<p>实时新闻，校园资讯全掌握</p></td>
						<td><h4>主题：<%=NewsMsgCount%></h4></td>
						<td><h5>回复：<%=HfNewsMsgCount%></h5></td>
					</tr>
				</table>
			</div>
		</div>
		<div id="pagebg"></div>
		<div id="line2"></div>
			<div id="copyright">
				<a>版权所有:蓝调吉他社 </a><a>| </a>
				<div id="admin">
					<a href="houtai_index.jsp">管理员登录</a>
				</div>
			</div>
	</div>
</body>
</html>
